Skip to content

Conversation

@MasterOdin
Copy link
Contributor

@MasterOdin MasterOdin commented Apr 2, 2025

Fixes #171

PR makes it so that instead of having getPort throw errors in some cases, it'll instead return an error on the callback. This allows for a singular error handling necessary for end users (namely around the callback), vs requiring them to both worry about the callback as well as wrapping the getPort call in a try/catch.

I think that there's more options validation that could happen here (e.g. if options.startPort is provided, should probably have similar checks), but that can be done in a follow-up once this pattern is established on how to return errors to the user.

Signed-off-by: Matthew Peveler <[email protected]>
@eriktrom
Copy link
Member

Yep I agree. Thanks again for helping out.

@eriktrom eriktrom merged commit 2110ec1 into http-party:master Apr 14, 2025
19 checks passed
@MasterOdin MasterOdin deleted the fix-error-thorws branch July 30, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove throws from getPort

2 participants